package top.banner.contentcenter.controller.content;

import org.springframework.web.bind.annotation.*;
import top.banner.contentcenter.auth.CheckAuthorization;
import top.banner.contentcenter.domain.dto.content.ShareAuditDTO;
import top.banner.contentcenter.domain.entity.share.Share;
import top.banner.contentcenter.service.content.ShareService;

import javax.annotation.Resource;

@RestController
@RequestMapping("/admin/shares")
public class ShareAdminController {

    @Resource
    private ShareService shareService;

    @PutMapping("/audit/{id}")
    @CheckAuthorization("admin")
    public Share auditById(@PathVariable Integer id, @RequestBody ShareAuditDTO auditDTO) {
        return this.shareService.auditById(id, auditDTO);
    }
}
